<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>User Tracking</title>
	<link rel="stylesheet" type="text/css" href="<?=base_url();?>js/calendar/tcal.css" />
	<script type="text/javascript" src="<?=base_url();?>js/calendar/tcal.js"></script> 
</head>
<style type="text/css">

	body { background:#F5F5F5; margin:0; padding:0;
	}
	#user_tracking form input{
		border:#CCCCCC 1px solid;
	}
	
	table.userview {
		font-size: 11px;
		color: #333333;
		border-width: 1px;
		border-color: #DEDEDE;
		border-collapse: collapse;
		margin-bottom:0px;
		/* margin-bottom:16px;
		margin-top:16px; */
	}
	
	table.userview th {
		border-width: 1px;
		padding: 8px;
		border-style: solid;
		border-color: #DEDEDE;
		background-color:#F3F3F3;
	}
	
	table.userview td {
		border-width: 1px;
		padding:10px 16px 8px 0;
		border-style: solid;
		border-color: #DEDEDE;
		background-color: #ffffff;
		padding-left:10px;
	}
	
	table.userview tr {
		background-color: #d4e3e5;
	}
	
	
	.pagination {
		margin:0px auto;
		text-align:center;
		width:100%;
		float:left;
		
	}
	
	.pagination p a {
		padding:4px 8px 4px 8px;
		background:#E9F5FE;
		border:#E4E4E4 1px solid;
		color:#fff;
		text-decoration:none;
		font-size:12px;
		width:90px;
		margin-right:2px;
		color:#333;
		
	}
	
	.pagination p a:hover {
		text-decoration:underline;
		background:#E9F5FE;
		border:#ccc 1px solid;
		color:#BD2031;
	}
	
	.pagination p strong {
		padding:4px 8px 4px 8px;
		background:#F5F5F5;
		border:#E6E6E6 1px solid;
		color:#BD2031;margin-right:2px;
		font-size:12px;
	}
</style>
<body>
	<div style="width:1100px; margin:0 auto; font-family:Arial, Helvetica, sans-serif; margin-top:10px;">
    	<form action="<?=site_url('user_tracking/getVisitorDate')?>" method="post" id="user_tracking">
        <h3 style="color:#FFF; font-size:14px; height:25px; padding-top:8px; padding-left:10px; background:#FF6D06; font-weight:bold;-webkit-border-radius: 6px;-moz-border-radius: 6px;border-radius: 6px;"><a href="<?=site_url("user_tracking");?>" style="text-decoration:none; color:#FFF;">HOME</a> &nbsp;|&nbsp; USER TRACKING </h3>
        
        <div style="border:#CCC 1px solid; float:left; height:620px; width:262px; font-size:12px; -webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px; padding:15px; background:#FFFFFF;">
            <div style="font-size:16px; font-weight:bold; margin:6px 0; border-bottom:#ccc 1px solid; height:20px;">Dashboard</div>
            <div style="-webkit-border-radius: 3px;-moz-border-radius: 3px;border-radius: 3px; background:#696969; height:22px; color:#fff; padding-top:4px; font-size:13px;">&nbsp;<img src="<?=base_url()?>images/user_white.png" width="16" height="16" align="absmiddle">&nbsp;All Visitor: <b><?=$this->db->count_all('hits_counter');?></b></div>
            <BR/>Today: <?php echo $visitorToday;?>
            <BR/>Yesterday: <?php echo count($visitorYesterday->result_array());?>
            <BR/>Last Weeks: <?php echo $visitorLastWeek;?>
            <BR/>Last Month: <? echo $visitorLastMonth;?>
        </div>
        
        <div style="float:right; width:790px;-webkit-border-radius: 6px; height:650px; -moz-border-radius: 6px; border-radius: 6px;border:#CCC 1px solid;background:#FFFFFF; ">        
        <table width="98%" border="0" cellspacing="2" cellpadding="2" style="font-size:12px; margin:8px;">
          <tr>
            <td height="24" style="font-size:16px; font-weight:bold;padding-top:10px; border-bottom:#ccc 1px solid">Select From Date</td>
          </tr>
          <tr>
            <td height="24">&nbspStart Date:</td>
          </tr>
          <tr>
            <td><div><input type="text" name="startDate" class="tcal" value="<? if(isset($_POST['startDate'])){echo $_POST['startDate'];}?>" style="border:#CCCCCC 1px solid; height:24px;" /></div> </td>
          </tr>
          <tr>
            <td height="24">&nbsp;End Date: </td>
          </tr>
          <tr>
            <td><div><input type="text" name="endDate" class="tcal" value="<? if(isset($_POST['endDate'])){echo $_POST['endDate'];}?>" style="border:#CCCCCC 1px solid;height:24px;" /></div></td>
          </tr>
          <tr><td><input type="submit" value="Submit" name="submit" /></td></tr>
        </table>
        <div style="border-top:#ccc 1px solid; padding-left:8px; margin:10px 0; padding-top:8px">Row count: <? if(isset($rowNum)){echo  $rowNum;} ?></div>
        <table width="98%" border="0" cellpadding="0" cellspacing="0" align="center" class="userview">
         <thead>
         <tr>
          <th>IP</th>
          <th>DATE</th>
        </tr>
        </thead>
        <tbody style="overflow:scroll">
        <?php if(isset($visitorDate)){
			foreach($visitorDate->result_array() as $rowVistor):?>
              <tr onMouseOver="this.style.backgroundColor='#ffff66';" onMouseOut="this.style.backgroundColor='#d4e3e5';">
                <td><?=$rowVistor['ip'];?></td>
                <td><?=$rowVistor['hits_date'];?></td>
              </tr>
            <? endforeach;
		}else {	
		foreach($visitorDate->result_array() as $rowVistor):?>
          <tr onMouseOver="this.style.backgroundColor='#ffff66';" onMouseOut="this.style.backgroundColor='#d4e3e5';">
            <td><?=$rowVistor['ip'];?></td>
            <td><?=$rowVistor['hits_date'];?></td>
          </tr>
        <? endforeach; 
		}?>
        <tr></tr>
        </tbody>
        </table>
        <div class="pagination"><?php echo $this->pagination->create_links(); ?></div>
        </div>      
      </form>
    </div>
    
</body>
</html>